﻿@using Ids4Review.AuthorizationServer.Models;
@model ConsentVm
@{
    ViewData["Title"] = "Consent";
}

<h2>@ViewData["Title"]</h2>
<form method="post" asp-action="index">
    <input type="hidden" value="@ViewData["returnUrl"]" name="returnUrl" />
    <div class="row">
        <div class="col-md-10 page-header">
            @if (!string.IsNullOrEmpty(Model.ClientLogoUrl))
            {
                <div>
                    <img src="@Model.ClientLogoUrl" alt="" width="128" />
                </div>
            }
            <h1>
                @Model.ClientName
                <small>希望使用您的账户</small>
            </h1>
        </div>
    </div>
    <div class="row">
        <div class="col-md-8">
            @if (Model.IdentityScopes != null && Model.IdentityScopes.Any())
            {
                <div class="panel">
                    <div class="panel-heading"><span class="glyphicon glyphicon-user"></span>个人信息</div>
                    <div class="panel-body">
                        <ul class="list-group">

                            @foreach (var item in Model.IdentityScopes)
                            {
                                @await Html.PartialAsync("_SelectedListScopeVmPartial.cshtml", item);
                            }

                        </ul>
                    </div>
                </div>
            }
            @if (Model.ApiResources != null && Model.ApiResources.Any())
            {
                <div class="panel">
                    <div class="panel-heading"><span class="glyphicon glyphicon-menu-hamburger"></span>用户授权</div>
                    <div class="panel-body">
                        <ul class="list-group">

                            @foreach (var item in Model.ApiResources)
                            {
                                @await Html.PartialAsync("_SelectedListScopeVmPartial.cshtml", item);
                            }

                        </ul>
                    </div>
                </div>
            }
            <label><input type="checkbox" name="rememberConsent" checked="@Model.AllowRememeberConsent" value="true" />记住我的选择</label>
        </div>
    </div>
    <button class="btn btn-primary" name="button" value="yes">确认</button>
    <button class="btn btn-default" name="button" value="no">取消</button>
</form>


